<template>
	<view class="container">
		<view class="status_bar">
			<!-- 这里是状态栏 -->
		</view>
		<view class="top-tabar">
			<view class="arrow" @click="returing"></view>
			<view class="title-tbar">
				救援记录
			</view>
			<!-- 添加一个空的占位元素保持平衡 -->
			<view class="placeholder"></view>
		</view>
		
		<!-- 修复卡片容器 -->
		<view class="card-container">
			<view class="card-tal">
				<uni-card class="rescue-card" title="换胎" :extra="rescueDate">
					<view class="order-list">
						<view class="order-item"> 
						<!-- v-for="(item, index) in orderList" :key="index" -->
							<view class="item">
								<text class="order-label">订单编号：</text>
								<!-- <text class="order-number">{{ item.number }}</text> -->
								<text class="order-number">12121211244564</text>
							</view>
							<view class="item">
								<text class="order-label">位置：</text>
								<!-- <text class="order-number">{{ item.number }}</text> -->
								<text class="order-number">洛阳市道北路32好xxx小区</text>
							</view>
							<view class="item">
								<text class="order-label">车牌：</text>
								<!-- <text class="order-number">{{ item.number }}</text> -->
								<text class="order-number">奔驰FWE4/豫A98FHJ</text>
							</view>
						</view>
					</view>
				</uni-card>
			</view>
			
			
			<view class="card-tal">
				<uni-card class="rescue-card" title="换胎" :extra="rescueDate">
					<view class="order-list">
						<view class="order-item"> 
						<!-- v-for="(item, index) in orderList" :key="index" -->
							<view class="item">
								<text class="order-label">订单编号：</text>
								<!-- <text class="order-number">{{ item.number }}</text> -->
								<text class="order-number">12121211244564</text>
							</view>
							<view class="item">
								<text class="order-label">位置：</text>
								<!-- <text class="order-number">{{ item.number }}</text> -->
								<text class="order-number">洛阳市道北路32好xxx小区</text>
							</view>
							<view class="item">
								<text class="order-label">车牌：</text>
								<!-- <text class="order-number">{{ item.number }}</text> -->
								<text class="order-number">奔驰FWE4/豫A98FHJ</text>
							</view>
						</view>
					</view>
				</uni-card>
			</view>
			
			
			<view class="card-tal">
				<uni-card class="rescue-card" title="换胎" :extra="rescueDate">
					<view class="order-list">
						<view class="order-item"> 
						<!-- v-for="(item, index) in orderList" :key="index" -->
							<view class="item">
								<text class="order-label">订单编号：</text>
								<!-- <text class="order-number">{{ item.number }}</text> -->
								<text class="order-number">12121211244564</text>
							</view>
							<view class="item">
								<text class="order-label">位置：</text>
								<!-- <text class="order-number">{{ item.number }}</text> -->
								<text class="order-number">洛阳市道北路32好xxx小区</text>
							</view>
							<view class="item">
								<text class="order-label">车牌：</text>
								<!-- <text class="order-number">{{ item.number }}</text> -->
								<text class="order-number">奔驰FWE4/豫A98FHJ</text>
							</view>
						</view>
					</view>
				</uni-card>
			</view>
		</view>
	</view>
</template>

<script setup>
	import { ref } from 'vue'
	
	// 模拟数据
	const rescueDate = ref('2023-02-15')
	const orderList = ref([
		{ number: '12121211244564' },
		{ number: '12121211244564' },
		{ number: '12121211244564' },
		{ number: '12121211244564' }
	])
	
	const returing = () => {
		uni.navigateBack()
	}
</script>

<style scoped lang="scss">
	.status_bar {
		height: var(--status-bar-height);
		width: 100%;
	}

	.title-tbar {
		color: white;
		font-size: 36rpx;
		text-align: center;
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
	}

	.top-tabar {
		display: flex;
		justify-content: space-between;
		align-items: flex-start; /* 顶部对齐 */
		background-color: #3486fd;
		height: 320rpx; /* 固定高度替代min-height */
		padding: 20rpx;
		position: relative;
	}

	.arrow {
		border-top: 2rpx solid white;
		border-right: 2rpx solid white;
		height: 17rpx;
		width: 17rpx;
		margin-top: 15rpx;
		transform: rotate(225deg);
		flex-shrink: 0;
		z-index: 10;
		
		/* 添加点击效果 */
		&:active {
			opacity: 0.7;
			transform: rotate(225deg) scale(0.95);
		}
	}

	.placeholder {
		width: 20rpx;
		height: 20rpx;
		visibility: hidden;
	}
	
	/* 修复卡片容器 - 关键修改 */
	.card-container {
		position: relative;
		width: 100%;
		margin-top: -240rpx; /* 减少负边距值 */
		z-index: 5;
	}
	
	.card-tal {
		width: 100%;
		/* 移除固定负边距，使用相对定位 */
	}
	
	/* 自定义卡片样式 */
	.rescue-card {
		border-radius: 20rpx !important;
		box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1) !important;
		overflow: hidden;
	}
	
	/* 深度选择器修改 uni-card 内部样式 */
	:deep(.uni-card) {
		border-radius: 20rpx;
	}
	
	:deep(.uni-card__header) {
		padding: 30rpx 30rpx 20rpx 30rpx;
		border-bottom: 1rpx solid #f0f0f0;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	
	:deep(.uni-card__header-title) {
		font-size: 32rpx;
		font-weight: bold;
		color: #333;
	}
	
	:deep(.uni-card__header-extra) {
		font-size: 28rpx;
		color: #999;
	}
	
	:deep(.uni-card__content) {
		padding: 30rpx;
	}
	
	/* 订单列表样式 */
	.order-list {
		display: flex;
		flex-direction: column;
		gap: 20rpx; /* 使用gap替代margin */
	}
	
	.order-item {
		// display: flex;
		align-items: center;
		padding: 0;
	}
	.item{
		margin-top: 10rpx;
		margin-bottom: 10rpx;
	}
	
	.order-label {
		font-size: 28rpx;
		color: #333;
		font-weight: normal;
		min-width: 140rpx; /* 固定标签宽度 */
	}
	
	.order-number {
		font-size: 28rpx;
		color: #666;
		flex: 1;
	}
	
	.container {
		min-height: 100vh;
		background-color: #f5f5f5;
		position: relative;
	}
</style>